<?php
include '/var/www/html/new/d/vendor/autoload.php';
include 'mail.php';
use Nette\Mail\Message;
use Nette\Mail\SendmailMailer;
class MailExec{
    public static function send($data,$mail){
        $mail = Mail::to(array($mail))
                        ->from('中国云顶 <postmaster@12301.cc>')
                        ->title('订单信息通知')
                        ->content($data);
        $mailer = new Nette\Mail\SmtpMailer($mail->config);
        try {
            $mailer->send($mail);
        } catch(Exception $e) {
            echo $e->getMessage();
        }
    }
}




